<!DOCTYPE html>
<html lang="en">
<head>
    <title>Title</title>
    <meta name="renderer" content="webkit" >
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <base href="<%=url%>">
    <script src="https://lib.baomitu.com/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://lib.baomitu.com/layui/2.6.5/layui.min.js"></script>
    <link href="https://lib.baomitu.com/layui/2.6.5/css/layui.min.css" rel="stylesheet">
</head>
<body style="text-align: center">
<div id="add-layer" style="display: none; padding: 20px">

    <div class="layui-form-item">
        <div class="layui-input-block">
            <div>
                <div style="float: left">
                    支付宝支付 <br/>
                    <img src="../../img/zhifubao.jpg" style="width: 150px;">
                </div>
                <div style="float: right">
                    微信支付 <br/>
                    <img src="../../img/weixin.jpg" style="width: 150px;">

                </div>
                <div style="clear: both"></div>

            </div>

            <div style="margin-top: 20px;padding-left: 150px">
                <button id="add1" class="layui-btn">支付完成</button>
                <button id="add2" class="layui-btn">取消预约</button>
            </div>
        </div>
    </div>

</div>
<h1><span id="a">測試</span></h1>
<input id="b" placeholder="请输入信息">
 <button id="but">按钮</button>







</body>
</html>
<script>
    $("#but").click(function () {
      var b=  $("#b").val()
        var patten=/^[\u4E00-\u9FA5]{1,6}$/;
        if(b==null||b=="" ){
        // $("#b").attr("placeholder","值不能为空");
            //     $("#b").attr("placeholder","值不能为空");
            //     document.getElementById("b").style.border="1px solid red" ;
            layer.confirm("余额不足，是否进行缴费",function () {
                layer.confirm("请选择缴费方式",{
                    btn:["扫码支付","现金支付"]
                },function (index) {
                    UpIndex= layer.open({
                        type: 1,
                        title: '请支付挂号费用15元',
                        skin: 'layui-layer-molv',
                        area: ['500px'],
                        content: $('#add-layer')
                    });
                },function () {
                   alert("现金支付")
                })



            })
        }
        // else if(!patten.test(b)){
        //     alert("请使用 规范 名称")
        //     $("#b").val("");
        //     $("#b").attr("placeholder"," 名称输入不规范");
        //     document.getElementById("b").style.border="1px solid red" ;
        // }
        // else {
        //   alert(b)
        // }
    })







</script>